#ifndef ANT_H
#define ANT_H

#include <stdint.h>

#include "Common.h"

typedef enum _antState
{
    DO_NICHT = 0,
    MAKE_RANDOM_MOVE = 1,
    IN_BATTLE = 2,
    GOEZ_FOR_FOOD = 4
} AntState;

class Ant : public ACell
{
    // true == мой муравей, иначе чужой
    bool owner;
    AntState antState;
    
public:
    Ant(int32_t rowCoord, int32_t columnCoord, bool isMy, AntState state = DO_NICHT) : ACell(rowCoord, columnCoord)
    {
        this->type = ANT;
        this->owner = isMy;
        this->antState = state;
    }
    
    Ant(const Ant & otherAnt) : ACell(otherAnt)
    {
        this->type = ANT;
        this->owner = otherAnt.owner;
        this->antState = otherAnt.antState;
    }
    
    bool isMyAnt() const
    {
        return this->owner;
    }
    
    bool isEmpty()
    {
        return false;
    }
    
    CellType getType()
    {
        return ANT;
    }
    
    void setAntState(AntState as)
    {
        this->antState = as;
    }
    
    AntState getAntState() const
    {
        return this->antState;
    }
    
    bool isBusy()
    {
        return (this->antState != DO_NICHT);
    }
    
};


class AntCompare
{
public:
    bool operator()(const Ant & a1, const Ant & a2)
    {
        return (a1.row() != a2.row()) || (a1.column() != a2.column());
    }

};

#endif /* ANT_H */
